package com.chuhe.starry.controller;

import com.chuhe.common.annotation.GlobalInterceptor;
import com.chuhe.common.domain.dto.MessageSendDto;
import com.chuhe.starry.websocket.MessageHandler;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 楚河
 * @Date: 2025年05月08日8:53
 */
@RestController
@RequestMapping("/user")
@Api(value = "用户登录注册接口", tags = "用户登录注册相关API", description = "用户登录注册相关API")
public class UserLoginController {
    @Autowired
    private MessageHandler messageHandler;

    @GetMapping("/test")
    @ApiOperation("测试信息")
    public String test(){
        MessageSendDto sendDto = new MessageSendDto();
        sendDto.setMessageContent("哈喽 World ！！！" + System.currentTimeMillis());
        messageHandler.sendMessage(sendDto);
        return "接口测试成功";
    }

}
